package com.dyz.leetcode._04_bitOperation;

public class _461_hammingDistance {
    public int hammingDistance(int x, int y) {
        int diff = x ^ y;
        int res = 0;
        while(diff!=0){
            diff = diff&(diff-1);
            res++;
        }
        return res;
    }
}
